<?php

namespace App\Repositories\Transformers;

use App\Models\Live;
use League\Fractal\TransformerAbstract;

class LiveTransformer extends TransformerAbstract
{
    public function transform(Live $live)
    {
        return [
            'id' => $live->id,
            'title' => $live->title,
            'url' => $live->url,
            'cover' => $live->cover,
            'live_time' => $live->live_time,
            'created_at' => $live->created_at != null ? $live->created_at->toDateTimeString() : null,
        ];
    }
}
